package momo.multitree.simulation;

import java.io.FileReader;
import java.util.LinkedHashSet;
import java.util.Random;
import java.util.Set;
import java.util.Vector;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import momo.multitree.structure.Edge;
import momo.multitree.structure.Graph;
import momo.multitree.structure.Node;
import momo.multitree.structure.Tree;
import momo.multitree.util.WeightCalculator;

public class OptWeightedTree extends SimulatedAnnealing {
	
	private double latWeightage;
	private double costWeightage;
	private double stabWeightage;

	public OptWeightedTree(Graph g, int maxIteration, int maxTrial, double temperature, double factor) {
		super(g, maxIteration, maxTrial, temperature, factor);
		this.latWeightage = WeightCalculator.DEFAULT_LATWEIGHTAGE;
		this.costWeightage = WeightCalculator.DEFAULT_COSTWEIGHTAGE;
		this.stabWeightage = WeightCalculator.DEFAULT_STABWEIGHTAGE;
	}
	
	public OptWeightedTree(Graph g, int maxIteration, int maxTrial, double temperature, double factor, 
							double latWeightage, double costWeightage, double stabWeightage) {
		super(g, maxIteration, maxTrial, temperature, factor);
		this.latWeightage = latWeightage;
		this.costWeightage = costWeightage;
		this.stabWeightage = stabWeightage;
	}

	public OptWeightedTree(Graph g) {
		super(g);
	}
	
	public double score(Tree t) {
		WeightCalculator cal = new WeightCalculator(t, this.g, latWeightage, costWeightage, stabWeightage);
		return cal.calWeight();
	}
	
}
